package client;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;

public class HomePanel extends JPanel{

	public static final int xSize=300;
	public static final int ySize=200;

	public HomePanel(){
		super(new BorderLayout());
		FilterPanel global = new FilterPanel();
		global.addListSelectionListener(new ToCritListener(global));
		add(new SearchFilterPanel(global), BorderLayout.CENTER);
		JPanel east = new JPanel(new GridLayout(2,1));
		FilterPanel fp = new FilterPanel();
		fp.addListSelectionListener(new ToCritListener(fp));
		FilterPanel priv = new FilterPanel();
		priv.addListSelectionListener(new ToCritListener(priv));
		TaggedPanel tp = new TaggedPanel("Popular", fp);
		add(tp, BorderLayout.EAST);
		Dimension d = new Dimension(xSize,ySize);
		tp.setSize(d);
		tp.setPreferredSize(d);
	}

	
	private class TaggedPanel extends JPanel{
		
		public TaggedPanel(String text, Component panel){
			super(new BorderLayout());
			add(new JLabel(text), BorderLayout.NORTH);
			add(panel, BorderLayout.CENTER);
			
		}
		
	}
	
}
